<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>学生管理--我的收藏</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/css/app.css">
    <link rel="stylesheet" href="assets/css/gb_my.css">
    <link rel="stylesheet" href="assets/css/font-awesome.css">
    <link rel="stylesheet" href="assets/css/bootstrap-reset.css">
    <link rel="stylesheet" href="assets/css/easydropdown.css">
</head>
<body data-type="chart">
<div class="am-g tpl-g">
    <!--头部-->
    <nav class="navbar navbar-default top-navbar">
        <div class="navbar-header">
            <a class="navbar-brand waves-effect waves-dark" href="javascript:;">
                <img src="assets/img/logo.png" alt="">
                <strong>轻课网考试系统</strong>
            </a>
            <div id="sideNav" href="">
                <i class="mulv QK QK-mulu"></i>
            </div>
        </div>
        <ul class="nav navbar-top-links navbar-right aaa">
            <li>
                <a id="down_" class="sign-out dropdown-button waves-effect waves-dark" href="javascript:;">
                    <span class="am-icon-sign-out"></span> 退出
                </a>
            </li>
            <li>
                <a class="dropdown-button waves-effect waves-dark" href="javascript:;"><b>欢迎你, <span class="userName"></span> </b></a>
            </li>
        </ul>
    </nav>
    <!--导航栏-->
    <nav class="navbar-default navbar-side">
        <div class="sidebar-collapse">
            <!--用户头像-->
            <div class="tpl-sidebar-user-panel">
                <div class="tpl-user-panel-slide-toggleable">
                    <div class="tpl-user-panel-profile-picture">
                        <img src="assets/img/user04.png" alt="">
                    </div>
                </div>
            </div>
            <dl class="list_dl">
                <dt class="list_dt">
                    <a href="index.html">
                        <span class="QK1 start_before"></span>
                        <p>学生平台</p>
                    </a>
                </dt>
                <dt class="list_dt">
                    <span class="QK1 topic_before"></span>
                    <p>我的考试</p>
                    <i class="QK1 list_dt_icon"></i>
                </dt>
                <dd class="list_dd">
                    <ul>
                        <li class="list_li">
                            <a href="student.html">我的试卷</a>
                        </li>
                        <li class="list_li">
                            <a href="examRecords.html">考试记录</a>
                        </li>
                    </ul>
                </dd>
                <dt class="list_dt">
                    <span class="QK1 paper_before"></span>
                    <p>自我检测</p>
                    <i class="QK1 list_dt_icon"></i>
                </dt>
                <dd class="list_dd">
                    <ul>
                        <li class="list_li">
                            <a href="testing.html">自我检测</a>
                        </li>
                        <li class="list_li">
                            <a href="error.html">检测结果</a>
                        </li>
                    </ul>
                </dd>
                <dt id="open" class="list_dt">
                    <span class="QK1 user_before"></span>
                    <p>个人管理</p>
                    <i class="QK1 list_dt_icon"></i>
                </dt>
                <dd class="list_dd" style="display: block">
                    <ul>
                        <li class="list_li">
                            <a href="personalData.html">个人资料</a>
                        </li>
                        <li class="list_li" id="style_li_a">
                            <a href="collection.html">题目收藏</a>
                        </li>
                    </ul>
                </dd>
                <dt class="list_dt">
                    <span class="QK1 chat_before"></span>
                    <p>聊天室</p>
                    <i class="QK1 list_dt_icon"></i>
                </dt>
                <dd class="list_dd">
                    <ul>
                        <li class="list_li">
                            <a href="chatroom.html">聊天室</a>
                        </li>
                    </ul>
                </dd>
            </dl>
        </div>
    </nav>
    <!-- 内容区域 -->
    <div id="page-wrapper">
        <div class="row collection_row">
            <div class="col-lg-6">
                <section class="panel">
                    <header class="panel-heading">
                        <span class="label label-primary">选择题库</span>
                        <div class="loading" id="header_loading">
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                        </div>
                    </header>
                    <div class="panel-body">

                    </div>
                </section>
            </div>
        </div>
    </div>
</div>
</body>
</html>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/theme.js"></script>
<script src="assets/js/easydropdown.js"></script>
<script src="assets/js/html5sv.js"></script>
<script src="assets/js/bootstrap-fileinput.js"></script>
<script type="text/javascript" src="assets/js/jquery.cookie.js"></script>
<script src="assets/js/amazeui.min.js"></script>
<script src="assets/js/amazeui.datatables.min.js"></script>
<script src="assets/js/dataTables.responsive.min.js"></script>
<script src="assets/js/student.js"></script>
<script>
    $(document).ready(function() {
        $(".list_dt").on("click", function() {
            $('.list_dd').stop();
            $(this).siblings("dt").removeAttr("id");
            if($(this).attr("id") == "open") {
                $(this).removeAttr("id").siblings("dd").slideUp();
            } else {
                $(this).attr("id", "open").next().slideDown().siblings("dd").slideUp();
            }
        });
    });
</script>
<script>
    $(document).ready(function() {
        $(".dropdown-button").dropdown();
        $("#sideNav").click(function() {
            if($(this).hasClass('closed')) {
                $('.navbar-side').animate({
                    left: '0px'
                });
                $(this).removeClass('closed');
                $('#page-wrapper').animate({
                    'margin-left': '260px'
                });
            } else {
                $(this).addClass('closed');
                $('.navbar-side').animate({
                    left: '-260px'
                });
                $('#page-wrapper').animate({
                    'margin-left': '0px'
                });
            }
        });
    });
    $(".dropdown-button").dropdown();
</script>
<script>
    $('.loading').css('display' , 'inline-block');
    var storage = window.localStorage;
    var user_id = storage["uid"];
    var class_id = storage["class_id"];
    var user_name = storage["user_name"];
    //请求题库类型
    $.ajax({
        url: localApi + "/QuestionDb/all",
        type: 'get',
        async:false,
        data: {
            apikey: '1'
        },
        success: function(result) {
//            console.log(result.data);
            if(result.msg == "success") {
                $.each(result.data, function(n, item){
//                        $("select[name='question_tx']").append("<option value='" + item.id + "'>" + item.dname + "</option>")
                    var every_questions = '<div class="row collection_row">\n' +
                        '                            <div data-text="Hover" class="col-lg-10 col-sm-10 collection_row_border set_9_btn-corner set_3_button4">\n' +
                        '                                <span class="line1"></span>\n' +
                        '                                <span class="line2"></span>\n' +
                        '                                <span class="line3"></span>\n' +
                        '                                <span class="line4"></span>\n' +
                        '                                <div class="questions_every">\n' +
                        '                                    <div class="value_every'+ item.id +' every_questions_number">\n' +
                        '                                        <h2>'+ item.dname +'</h2>\n' +
                        '                                    </div>\n' +
                        '                                    <div id="img'+ item.id +'" class="img_logo_every">\n' +
                        '                                        <i class="QK2"></i>\n' +
                        '                                    </div>\n' +
                        '                                </div>\n' +
                        '                                <div class="hover_show">\n' +
                        '                                   <a href="collectionList.html?pid='+ item.id +'">\n' +
                        '                                       <p>查看题库</p>\n' +
                        '                                   </a>\n' +
                        '                            </div>\n' +
                        '                        </div>';
                    $('.panel-body').append(every_questions);
                    if(item.id == '16'){
                        $('#img' + item.id).children('.QK2').addClass('QK-java');
                    }
                    if(item.id == '18'){
                        $('#img' + item.id).children('.QK2').addClass('QK-shujuku');
                    }
                    if(item.id == '19'){
                        $('#img' + item.id).children('.QK2').addClass('QK-qianduankaifa');
                    }
                    if(item.id == '20'){
                        $('#img' + item.id).children('.QK2').addClass('QK-kuangjia');
                    }
                });
                $.ajax({
                    url: localApi + "/QuestionFavorite/DbNameAndNumber",
                    type: 'get',
                    async:false,
                    data: {
                        apikey: '1',
                        uid:user_id
                    },
                    success:function (result) {
                        console.log(result);
                        $('.loading').css('display' , 'none');
                        if(result.data == 'error'){
                            var number_collection = '<p>共收藏' +
                                '<strong class="timer count count-number" data-to="0" data-speed="1500"></strong>道题</p>';
                            $('.every_questions_number').append(number_collection);
                        }else{
                            $.each(result.data , function (n , item) {
                                if(item.dbid == '16'){
                                    var number_collection = '<p>共收藏' +
                                        '<strong class="timer count count-number" data-to="'+ item.number +'" data-speed="1500"></strong>道题</p>';
                                    $('.value_every'+ item.dbid +'').append(number_collection);
                                }else {
                                    var number_collection = '<p>共收藏' +
                                        '<strong class="timer count count-number" data-to="0" data-speed="1500"></strong>道题</p>';
                                    $('.value_every16').append(number_collection);
                                }
                                if(item.dbid == '18'){
                                    var number_collection = '<p>共收藏' +
                                        '<strong class="timer count count-number" data-to="'+ item.number +'" data-speed="1500"></strong>道题</p>';
                                    $('.value_every'+ item.dbid +'').append(number_collection);
                                }else {
                                    var number_collection = '<p>共收藏' +
                                        '<strong class="timer count count-number" data-to="0" data-speed="1500"></strong>道题</p>';
                                    $('.value_every18').append(number_collection);
                                }
                                if(item.dbid == '19'){
                                    var number_collection = '<p>共收藏' +
                                        '<strong class="timer count count-number" data-to="'+ item.number +'" data-speed="1500"></strong>道题</p>';
                                    $('.value_every'+ item.dbid +'').append(number_collection);
                                }else {
                                    var number_collection = '<p>共收藏' +
                                        '<strong class="timer count count-number" data-to="0" data-speed="1500"></strong>道题</p>';
                                    $('.value_every19').append(number_collection);
                                }
                                if(item.dbid == '20'){
                                    var number_collection = '<p>共收藏' +
                                        '<strong class="timer count count-number" data-to="'+ item.number +'" data-speed="1500"></strong>道题</p>';
                                    $('.value_every'+ item.dbid +'').append(number_collection);
                                }else {
                                    var number_collection = '<p>共收藏' +
                                        '<strong class="timer count count-number" data-to="0" data-speed="1500"></strong>道题</p>';
                                    $('.value_every20').append(number_collection);
                                }
                            });
                        }
                    }
                });
            }else{
                alert("出现bug");
            }
        }
    });
</script>
<script src="assets/js/numberScorll.js"></script>